<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript">
		function dojobmakeemail(value, row, index) {
			var remove = "", makedemaildetail = "";
			
			makedemaildetail = "<a onclick='deleteboxback(" + row.emailId+ ")' class='easyui-linkbutton button-teal handle-btn'>恢复</a>";
			remove = "<a onclick='deleteboxdelete(" + row.emailId+ ")' class='easyui-linkbutton button-darkblue handle-btn'>删除</a>";
			return makedemaildetail + remove;
		}
		/* 垃圾箱恢复按钮 */
		function deleteboxback(emailId){
			$.post('deleteback',{data:emailId},function(data){
				$.messager.alert('提示', '恢复成功！', 'info'); 
				$("#deletedemail-list").datagrid("load");
			});	
			
		}
		
		/* 垃圾箱永久删除 */
		function deleteboxdelete(emailId){
			$.post('deletedelete',{data:emailId},function(data){
				$.messager.alert('提示', '删除成功！', 'info'); 
				$("#deletedemail-list").datagrid("load");
			});	
			
		}
	</script>
	<div class="easyui-layout" fit="true">
		<!-- 垃圾箱 -->
		<div id="makedemail" style="width:100%;height:100%;">
	        <table id="deletedemail-list" class="easyui-datagrid" style="height:100%;width:100%;"
			data-options="
				url:'to_deletedemail',
				autoRowHeight:false,
				striped:true,
				pagination:true,
				rownumbers:true,
				singleSelect:true,
				fitColumns:true,
				remoteSort:false,
				pageList:[5,10]
			">   
        	<thead>   
	            <tr>
	            	<th data-options="field:'emailId',checkbox:true"></th> 
	            	<th style="width:8%;" align="center" data-options="field:'name'">发件人</th> 
	            	<th style="width:8%;" align="center" data-options="field:'reservename'">收件人</th>
	            	<th style="width:20%;" align="center" data-options="field:'startdate'">发件时间</th>
	            	<th style="width:30%;" align="center" data-options="field:'reservestate'">收件状态</th>  
	            	<th style="width:10%;" align="center" data-options="field:'copynum'">抄送数量</th>  	  
	            	<th style="width:24%;" align="center" data-options="field:'dojob',formatter:dojobmakeemail">操作</th>                  
	            </tr>   
       		</thead>   
    		</table>
		</div>
	</div>	
</body>
</html>